<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="zh-CN" >
<head>
<base href="<%=basePath%>" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>院长信箱-上海市嘉定区人民法院



</title>

<style>

	
.nav_jd{
	margin-top:-5px;\9;/*ie6,ie7,ie8*/
	*margin-top:-5px;#FFFF00;/*ie7*/
	_margin-top:-95px;#FF0000;/*ie6*/
	margin-left:15px;\9;/*ie6,ie7,ie8*/
	*margin-left:15px;#FFFF00;/*ie7*/
	_margin-left:-95px;#FF0000;/*ie6*/
	display:inline;
	}
.nav_jd{
	margin-top:-5px;	
	margin-left:25px;
	*margin-left:-105px;
	_margin-left:-95px;
	display:inline;
	}
</style>
<link rel="stylesheet" href="web/pages/css/jd_css.css" type="text/css" />
<script type="text/javascript" src="web/pages/js/jquery-1.7.1.min.js"></script>
	<script >
	$(function()
	{

		$("#submitInfo").click(function()
		{
		 if(document.getElementById("name").value=="")
		 {
		 	alert("姓名不能为空。");
		 	$("#name").focus();
		 	return;
		 }else if (document.getElementById("name").value.length>15){
		 	alert("请输入正确的姓名。");
		 	$("#name").focus();
		 	return;
		 }
		 if(document.getElementById("homeaddress").value=="")
		 {
		 	alert("地址不能为空。");
		 	$("#homeaddress").focus();
		 	return;
		 }else if (document.getElementById("homeaddress").value.length>50){
		 	alert("请输入正确的地址。");
		 	return;
		 }
		 if(document.getElementById("phoneno").value=="")
		 {
		 	alert("联系电话不能为空。");
		 	$("#phoneno").focus();
		 	return;
		 }else if (document.getElementById("phoneno").value.length>20){
		 	alert("请输入正确的联系电话。");
		 	$("#phoneno").focus();
		 	return;
		 }
		 if(document.getElementById("idno").value=="")
		 {
		 	alert("身份证号不能为空。");
	 		$("#idno").focus();
		 	return;
		 }else if (document.getElementById("idno").value.length>18){
		 	alert("请输入正确的身份证号。");
		 	$("#idno").focus();
		 	return;
		 }
		
		  if(document.getElementById("caseno").value.length>50)
		 {
		 	alert("请输入正确的案号。");
		 	$("#caseno").focus();
		 	return;
		 }
		
		  if(document.getElementById("title").value=="")
		 {
		 	alert("标题不能为空。");
		 	$("#title").focus();
		 	return;
		 }else if (document.getElementById("title").value.length>50){
		 	alert("请输入正确的标题。");
	 	 	$("#title").focus();
		 	return;
		 }
		 
		  if(document.getElementById("content").value=="")
		 {
		 	alert("内容不能为空。");
	 		$("#content").focus();
		 	return;
		 }
			$.ajax({
				type: "POST",
				url: "addMailInfo",
				dateType: "json",
				data: {"name": $("#name").val(), "homeAddress": $("#homeaddress").val(), "phoneNo": $("#phoneno").val(), "idNo": $("#idno").val(), "isInvolved": $("#isinvolved").val(), "caseNo": $("#caseno").val(), "isclosed": $("#isclosed").val(), "title": $("#title").val(),"content": $("#content").val()},
				success: function(returnedData){
						var json = eval( "("+returnedData+")" );
						srts = json.uniqueCode.split(","); 
						alert("信件编号为:"+json.fileCode+"\r\n查看密码为:"+json.uniqueCode+"\r\n请妥善保管查看密码,以备查看回复内容!");
						$("#reset_mailbox").click();
						var str = "<font color=\"red\">您刚刚提交的信件编号为:" + json.fileCode + "</font>";
						$("#submitted").html(str);
				}
			});
		});
	});
    function reloadVerifyCode(obj){  
        obj.src = "<%=request.getContextPath()%>/servlet/ImageServlet.servlet?d=" + new Date();  
    }  
     
     function queryAnswer(){
  //   alert("该信件未回复或密码不正确！");
   //  return false;
     var id = document.getElementById("id").value;
     if(id==""){
     	alert("回复码不能为空,请重新输入!");
     	return;
     }
     var url = "queryAnswer.action?code="+id;
     var verifyCode = document.getElementById("verifyCode").value;
     var passCode = document.getElementById("passCode").value;
     //alert('<%=session.getAttribute("validateCodeRecruit") %>');
     if(passCode == '<%=session.getAttribute("validateCodeRecruit") %>'){
     
     
     			$.ajax({
				type: "POST",
				url: "queryAnswer",
				dateType: "json",
				data: {"code": $("#id").val()},
				success: function(returnedData){
						var json = eval( "("+returnedData+")" );
						if(json.reply == "jump"){
							window.location="getAnswerDtl.action?code="+json.code;
						}else{
							alert(json.reply);
							$("#pic").click();  
						}
						
				}
			});
     //	alert(verifyCode);
     //	document.mailboxform.action=url;
	 //	document.mailboxform.submit();  
     }else{
     	alert("验证码错误,请重新输入!");
     }
    }
    function checklength(maxlimit) {
	var textarea = document.getElementById("content");
	var input = document.getElementById("myInput");
	
	
	if (textarea.value.length > maxlimit)
	{
		alert("输入超过最大字符数")	;
		//如果元素区字符数大于最大字符数，按照最大字符数截断；  
		textarea.value = textarea.value.substring(0, maxlimit);  	
		}  
		else
		{
			//在记数区文本框内显示剩余的字符数；  
		input.value = maxlimit - textarea.value.length;  
		}  
	}    
	</script>
</head>
<body style="">
 <input type="hidden" id="passCode" name="passCode" value="<%=session.getAttribute("validateCodeRecruit") %>">
   <!--页面开始-->
<div id="container" align="center">
  <div id="D-wrapper" align="center" style="background:url(web/pages/images/contact_bg.png) no-repeat" >  
   
    <!--头部开始-->
    <div id="header_jd" >
      <!--logo开始-->
     <div id="D-logo"><a href="mainpageInfo.action"><img src="web/pages/images/logo_left.gif" border="0" width="332" height="69" /></a></div><!--logo结束-->

<script>

//通用二级页面的跳转共用
function goAction(action,className){

	className= encodeURI(encodeURI(className));
	var str = action+"&cName="+className;
	window.open(str);
  	
}

 function show(id){
    var obj=document.getElementById(id);
    obj.style.display="";
 }
 
  function closes(id){
      var obj=document.getElementById(id);
    obj.style.display="none"; 
 
 }
 
 

</script>

 <s:include value="header.jsp"></s:include>	



    </div>	<!--头部结束-->
   
    <!--主体内容开始-->
    <div id="D-main"  style="background:url(web/pages/images/contact_mainbg.png) no-repeat" >
	  <div class="list_address">您所在的位置：首页   >>   院长信箱</div>
	   <div class="list_title" >  院长信箱</div>
		<div class="xwkj_yz" align="center"> 
		<table align="center"   width="842"  height="160" border="0" cellpadding="0" cellspacing="0" style=" margin-top:0px; margin-bottom:0px; margin-left:37px; display:inline;">
		<tr>
		<td valign="top" background="web/pages/images/email_bg.png">
		  <table cellpadding="1" cellspacing="1" border="0" >
		  <tr>
		  <td width="188"></td>
		  <td width="235" align="left" style="font-size:14px; line-height:22px;">
		  <b>&nbsp;</b><br />
		  <span style="font-size:14px;  font-weight:bold; text-align:left;">使用说明:</span><br />
请正确填写相关信息后提交，请妥善保管系统生成的查看回复密码，当您的信件得到回复后，在右框中输入该密码即可查看回复信息。</td>
		  <td width="35"></td>
		  <td width="">
		   <form id="answerform" action="">
		    <table border="0" cellpadding="2" cellspacing="1" style="line-height:24px; margin-left:15px; margin-top:10px; display:inline;">
			 <tr>
			  <td width="52" height="18" align="right" style="text-align:right">查看回复</td>
			  <td width="140"></td>
			  <td></td>
			  <td></td>
			 </tr>
			 
			 
			 <tr>
			  <td width="52" height="18" align="right" style="text-align:right">查看密码</td>
			  <td align="left">&nbsp;<input type="text" name="id" id="id" class="td_yz1" /></td>
			  <td rowspan="2">
			  <a onclick="queryAnswer();" style="cursor:pointer">
			  	<img  src="web/pages/images/btn_ok1.png"  border="0" width="84" height="52" alt="" align="top" /></a></td>
			  <td></td>
			 </tr>
			 
			 <tr valign="bottom">
			  <td width="52" height="18" align="right" style="text-align:right">验证码</td>
			  <td align="left" valign="bottom" >&nbsp;
			  		<input type="text" name="verifyCode" id="verifyCode" class="td_yz2" size="8" maxlength="4" />
			  		 <img id="pic" align="absbottom" style="align:bottom" alt="看不清楚，换一张" src="<%=request.getContextPath() %>/servlet/ImageServlet.servlet" onclick="reloadVerifyCode(this);" style="cursor: hand;"  border="0"  width="50" height="22"/>  
			  <td></td>
			 </tr></table>
			  </form>
		  </td>
		  </tr></table>
		  
		</td>
		</tr></table>
	  </div>
 <form id="mailboxform" name="mailboxform" action="" method="post">
	   <!--我要咨询开始 -->
	   <div class="list_title">我要咨询 </div>
	   <div class="detail_text" style="text-align:left;">如果有什么好的建议和意见,请您填写下表直接给我发送邮件,谢谢!  </div>
	   	<div class="xwkj_yz" align="center"> 
		<table align="center"  width="842"  height="" border="0" cellpadding="0" cellspacing="0" style=" margin-top:0px; margin-bottom:10px; margin-left:37px; line-height:22px;  border:3px solid #92b0c6; display:inline;" >
		<tr>
		<td valign="top">
		
		<table border="0" cellspacing="2" cellpadding="2"  style="margin-left:20px; margin-top:5px; display:inline;" > 
        
		<tr>
		<td style="text-align:right;"><span style="color:#FF0000; font-weight:bold;">*</span>姓名:</td>
		<td align="left"><input  type="text" id="name" class="td_yz"/></td>
		<td width="20"></td>
		<td style="text-align:right;"><span style="color:#FF0000; font-weight:bold;">*</span>联系电话:</td>
		<td align="left">&nbsp;&nbsp;<input  type="text" id="phoneno" class="td_yz"/></td>
		</tr> 
		
		<tr>
		<td style="text-align:right;"><span style="color:#FF0000; font-weight:bold;">*</span>地址:</td>
		<td align="left"><input  type="text" id="homeaddress" class="td_yz" /></td>
		<td ></td>
		<td style="text-align:right;"><span style="color:#FF0000; font-weight:bold;">*</span>身份证号:</td>
		<td align="left">&nbsp;
			<input  type="text" id="idno" class="td_yz"/></td>
		</tr> 

		<tr>
		<td style="text-align:right;">是否涉案:</td>
		<td align="left">&nbsp;
			<input type="radio" id="isinvolved" name="isinvolved" value="1"  />
			<label for="ctl00_ContentPlaceHolder1_rdbtn_pj">是</label>&nbsp;&nbsp;&nbsp;
			<input type="radio" id="isinvolved" name="isinvolved" value="0" checked="checked"/>
			<label for="ctl00_ContentPlaceHolder1_rdbtn_shejian">否</label>&nbsp;&nbsp;&nbsp;</td>
		<td width="20"></td>
		<td style="text-align:right;">是否审结:</td>
		<td align="left">&nbsp;
			<input  type="radio"  id="isclosed" name="isclosed" value="1"  />
			<label for="ctl00_ContentPlaceHolder1_rdbtn_sa">是</label>&nbsp;&nbsp;&nbsp;
			<input id="isclosed" name="isclosed" value="0" type="radio" checked="checked"/>
			<label for="ctl00_ContentPlaceHolder1_rdbtn_shejian">否</label>&nbsp;&nbsp;&nbsp;</td>
		</tr> 
		
		<tr>
		<td style="text-align:right;">案号:</td>
		<td align="left"><input id="caseno" type="text"  class="td_yz" /></td>
		<td width="20"></td>
		<td style="text-align:right;"><span style="color:#FF0000; font-weight:bold;">*</span>标题:</td>
		<td align="left">&nbsp;&nbsp;<input  type="text" id="title" name="title" class="td_yz"/></td>
		</tr> 
		<tr>
		<td align="right" valign="top" style="text-align:right;"><span style="color:#FF0000; font-weight:bold;">*</span>内容:</td>
		<td align="left" colspan="4">
		<textarea name="content"   cols="20" id="content" onKeyDown="checklength(1500);" onKeyUp="checklength(1500);"class="yz_textarea" ></textarea>
		
		</td>
		</tr>
		<tr>
			<td>
			
			</td>
			<td align="left">您还可以输入: <input id="myInput" name="remLen" type="text" value="1500" size="5" readonly="readonly" />个字符 &nbsp;&nbsp;  <div  id="submitted">	</div></td>
		</tr>
		<tr>
		<td style="text-align:right;"></td>
		<td colspan="3" align="center">
		<a  style="cursor:pointer;">
		<img id="submitInfo" src="web/pages/images/btn_ok.png"  border="0" width="66" height="34" alt="" align="top" /></a>&nbsp;&nbsp;&nbsp;&nbsp;</td>
		<td align="left">
		<a style="cursor:pointer">
		<input id="reset_mailbox" type="reset"   style="cursor:pointer ;background-image: url(web/pages/images/btn_cancel.png);width:66px;height:34px;border:0" value=""   alt=""  align="top"     />
	<!-- <img src="web/pages/images/btn_cancel.png" border="0" width="66" height="34" alt=""  align="top"  /> -->	
		</a>
		</td>
		</tr>
		
		<tr>
		<td style="text-align:right;"></td>
		<td>&nbsp;</td>
		<td width="20"></td>
		<td ></td>
		<td>&nbsp;</td>
		</tr>			
		</table>
		
	 
		</td>
		</tr>
		</table>
		 
	  </div><!--我要咨询结束 -->
</form>		  
	 <!--  	<div id="D-main-content" >
		<div class="xwkj"> 
		<table width="600"  height="300" border="0" cellpadding="0" cellspacing="0" style="margin-top:0px; margin-bottom:0px; display:inline;">
		<tr>
		<td valign="top"></td>
		<td width="240" valign="top">
		<p style="line-height:18px; ">
		   <b> </b></br> 
        </p> 
		</td>
		<td valign="top">
		</td>				
		</tr>
		</table>
	  </div>
	</div>-->
  </div>
	<!--主体内容结束-->

  <!--脚部开始-->
 <jsp:include page="foot.jsp"/> 

  <div>
</div>
</body>
</html>
 
 



